﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using HF.Architecture.Data;
using HF.User.Data;

public partial class HometopPage : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string userId = Page.User.Identity.Name;
        string userName = UserData.GetInstance().GetUserNameById(userId);
        lbUsername.Text = "&nbsp;" + "<FONT color=\"DarkOrange\">" + userName + "[" + userId + "]</FONT>" + ",您好!  " + "今天是" + System.DateTime.Now.ToString("yyyy年MM月dd日") + "&nbsp;" + changeDate(System.DateTime.Now.DayOfWeek.ToString());
    }
    private string changeDate(string day)
    {
        string[] english ={ "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" };
        string[] china ={ "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日" };
        int j = 0;
        for (int i = 0; i <= 6; i++)
        {
            if (english[i] == day)
                j = i;
        }
        return china[j];
    }
}
